package com.hbnu.exception;

import java.util.Scanner;

/**
 * @author kittychen
 * @date 2025-09-28 下午 2:33
 */
public class ExceptionDemo06 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int input = scanner.nextInt();

        int result = method(input);

        System.out.println(result);
    }

    private static int method(int input) {
        if (input == 0) {
            throw new ArithmeticException("输入不能为0");  // 手动抛异常对象
        } else {
            return 1 / input;
        }

    }
}
